﻿using Mes.Domain.BoundedContext;

namespace Mes.Application.DTO.Inputs.MasterData
{
    /// <summary>
    /// 新增物料入参
    /// </summary>
    public class AddMaterialInput
    {
        /// <summary>
        /// 物料编码
        /// </summary>
        public string Code { get; set; } = string.Empty;

        /// <summary>
        /// 物料名称
        /// </summary>
        public string Name { get; set; } = string.Empty;

        /// <summary>
        /// 物料类Id
        /// </summary>
        public int MaterialClassId { get; set; }

        /// <summary>
        /// 物料类名称
        /// </summary>
        public string MaterialClassName { get; set; } = string.Empty;

        /// <summary>
        /// 计量单位Id
        /// </summary>
        public int MeasuringUnitId { get; set; }

        /// <summary>
        /// 计量单位名称
        /// </summary>
        public string MeasuringUnitName { get; set; } = string.Empty;

        /// <summary>
        /// 小数位数
        /// </summary>
        public int PrecisionPlace { get; set; }

        /// <summary>
        /// 规格
        /// </summary>
        public string Specification { get; set; } = string.Empty;

        /// <summary>
        /// 生产单元Id
        /// </summary>
        public int? ProdutionUnitId { get; set; }

        /// <summary>
        /// 生产单元名称
        /// </summary>
        public string ProdutionUnitName { get; set; } = string.Empty;

        /// <summary>
        /// 备注
        /// </summary>
        public string Remark { get; set; } = string.Empty;

        /// <summary>
        /// 物料清单Id列表
        /// </summary>
        public IList<int> MaterialBOMIds { get; set; } = new List<int>();
    }

    /// <summary>
    /// 编辑物料入参
    /// </summary>
    public class UpdateMaterialInput
    {
        /// <summary>
        /// 物料Id
        /// </summary>
        public int Id { get; set; }

        /// <summary>
        /// 物料类Id
        /// </summary>
        public int MaterialClassId { get; set; }

        /// <summary>
        /// 物料类名称
        /// </summary>
        public string MaterialClassName { get; set; } = string.Empty;

        /// <summary>
        /// 计量单位Id
        /// </summary>
        public int MeasuringUnitId { get; set; }

        /// <summary>
        /// 计量单位名称
        /// </summary>
        public string MeasuringUnitName { get; set; } = string.Empty;

        /// <summary>
        /// 小数
        /// </summary>
        public int PrecisionPlace { get; set; }

        /// <summary>
        /// 规格
        /// </summary>
        public string Specification { get; set; } = string.Empty;

        /// <summary>
        /// 生产单元Id
        /// </summary>
        public int? ProdutionUnitId { get; set; }

        /// <summary>
        /// 生产单元名称
        /// </summary>
        public string ProdutionUnitName { get; set; } = string.Empty;

        /// <summary>
        /// 备注
        /// </summary>
        public string Remark { get; set; } = string.Empty;

        /// <summary>
        /// 物料清单Id列表
        /// </summary>
        public IList<int> MaterialBOMIds { get; set; } = new List<int>();
    }

    /// <summary>
    /// 分页查询物料清单入参
    /// </summary>
    public class GetMaterialsInput
    {
        /// <summary>
        /// 查询关键字
        /// </summary>
        public string? KeyWord { get; set; }

        /// <summary>
        /// 物料类类型名称
        /// </summary>
        public string? MaterialClassTypeName { get; set; }

        /// <summary>
        /// 分页参数
        /// </summary>
        public PagedInput PagedInput { get; set; } = new PagedInput();
    }
}
